package com.ruoyi.system.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 消息对象 l_message
 *
 * @author zyb
 * @date 2022-01-02
 */
@Data
public class LMessage extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键自增 */
    @TableId(value = "mid", type = IdType.AUTO)
    private Long mid;

    /** 内容 */
    @Excel(name = "内容")
    private String content;

    /** 发送用户id */
    private Long userid;

    @TableField(exist = false)
    @Excel(name = "发送用户")
    private String nickName;

    /** 到用户id */
    @Excel(name = "到用户id")
    private Long togid;

    /** 发送时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date mtime;

    /** 是否查看 */
    @Excel(name = "是否查看")
    private Integer isbrowse;

    /** 停用 */
    @Excel(name = "停用")
    private Integer closed;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("mid", getMid())
            .append("content", getContent())
            .append("userid", getUserid())
            .append("togid", getTogid())
            .append("mtime", getMtime())
            .append("isbrowse", getIsbrowse())
            .append("closed", getClosed())
            .append("remark", getRemark())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateTime", getUpdateTime())
            .append("updateBy", getUpdateBy())
            .toString();
    }
}
